<!--the header of pages in first subfolder of the project  -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="cn.edu.nju.ws.sview.views.User,cn.edu.nju.ws.sview.views.Group" %>   
<link rel="stylesheet" type="text/css" href="/sview/css/bootstrap_button.min.css" /> 
<link rel="stylesheet" type="text/css" href="/sview/css/bootstrap_tabs_min.css"></link>
<script type="text/javascript" src="/sview/script/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	if($("#first").val()=="1"){
		selectGroupAtLogin();
	}
});
</script>
<%
   String from = request.getParameter("f");
%>
<div class="header_bar" >
  <div class="bar-container">
    <div class="nav nav_width">
     <ol>
     <%if(from!=null&&from.equals("e")){ %>
     <li class="nav-select">
     <%} else{ %>
         <li>
     <%} %>
         <span class="lc"><a href='/sview/views/index.jsp?lang=zh'>实体</a></span>
     </li>
     <%if(from!=null&&from.equals("d")){ %>
     <li class="nav-select">
     <%} else{ %>
         <li>
     <%} %>
          <span class="lc"><a href='/sview/relations/index.jsp?lang=zh'>数据集</a></span>
     </li>
     </ol>
    </div>
    <div class="setting">
     <ol>
     <li>
        <span class="lc account-box"  onselectstart="return false;">
           <span class="uinfo">
           <% 
       		String user = (String)session.getAttribute("user"); 
       		if(user==null){
     	   %>
         		<a  onClick="login('zh')">登录</a>
     	  <%
            }else{
          %>
                <%=user%>
         <%} %>
         </span>
         <%
             String groupName = (String)session.getAttribute("groupName");
	         if(user!=null&&groupName!=null){
	     %>
	       <span class="ginfo">
	        ( <%=groupName%> )
	       </span>
         <%}%>
         <%if(user!=null){ %>
         <span class="ardw"></span>
         <%} %>
      </span>
    </li>
     <%if(user!=null){ %>
     <!-- for history -->
     	<li><span class="usplitBox"><span class="usplit"></span></span></li>
        <li>
     <%
//     String type = "";
//     if(from!=null&&from.equals("e")){
//     	type = "entity";
//	 } else if(from!=null&&from.equals("d")){
//	 	type = "dataset";
//     } %>
        	<span class="lc history-box" lang='zh'> <%-- type='<%=type %>' --%>
	        	<span><a onselectstart="return false;">历史</a></span>
	        	<span class="ardw"></span>
        	</span>
        </li>
      <!-- end of history -->  
      
        <li><span class="usplitBox"><span class="usplit"></span></span></li>
        <li><span class="lc"><a  onClick="logout('zh')" class="logout">退出</a></span></li>
     <%} %>     
     <li><span class="usplitBox"><span class="usplit"></span></span></li>
     <li><span class="lc"><a id="set-option" href="javascript:void(0)"><span class="set_options"></span></a></span></li>
     </ol>
    </div>
  </div>
   <div class="accmenu">
     <ol>
         <li>
         <div  class="ghintBox">
         <%
         if(groupName!=null){
        	 int gid = Group.getGroupIdByName(groupName);
        	 String gprfileHref = "/sview/group/gprofile.jsp?gid="+gid;
         %>
         <span class="ghint">您以&nbsp<a href="<%= gprfileHref%>" target="_blank"><%=groupName%></a>&nbsp;登陆</span>
         <%}else{ %>
         <span class="ghint">您登陆时未选择编辑组</span>
         <%} %>
         </div>
         <% if(groupName!=null){ %> 
         <div><a href="javascript:void(0)"  onClick="group_set('zh')">切换编辑组</a></div>
          <%}else{ %>
          <div><a href="javascript:void(0)" onClick="group_set('zh')">选择编辑组</a></div>
         <%} %>
         <div><a href="/sview/account.jsp?lang=zh">账号设置</a></div>
         </li>
     </ol>
  </div>
  <div class="historymenu">
  	<ul class="historynav nav-tabs" lang='zh'>
     <%if(from!=null&&from.equals("e")){ %>
     	<li id="entity_tab" class="active">
     		<a href="javascript:void(0)">实体</a>
     	</li>
     	<li id="collection_tab">
     		<a href="javascript:void(0)">实体集</a>
     	</li>
  	 <%}else if(from!=null&&from.equals("d")){%>
  	 	<li id="dataset_tab" class="active">
     		<a href="javascript:void(0)">数据集</a>
     	</li>
  	 <%}%>	
  	</ul>
  	<div id="history-list" class="history-list"></div>
  </div>
  <div class="dmenu" id="dmenu">
    <ol>
     <%if(user==null || (new User(user)).getPreferedLanguages().size()>1){%>
     <li  class='lset'><a href="javascript:void(0)" onClick="lang_set('zh')">切换语言</a></li>
      <%} if(user!=null&&(new User(user)).getPreferedLanguages().size()>1){%> 
      <li class="mspacingLittle"></li>
     <% }if(user!=null) {%>
     <li><a href="/sview/group/message_zh.jsp">消息</a></li>
     <li><a href="/sview/views/bm_manage_zh.jsp">收藏</a></li>
     <%} %>
    </ol>
  </div>
</div>
  <%
     int firstlogin =0;
     boolean firstLogin = false;
     Boolean sessionFL = (Boolean)session.getAttribute("firstLogin");
     if(sessionFL!=null){
    	 firstLogin= Boolean.valueOf(sessionFL);
     }
     if(firstLogin){
    	 session.setAttribute("firstLogin",false);
    	 firstlogin = 1;
     }
  %>
     <input type="hidden" id="first" value="<%=firstlogin %>" />